home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  11.0 KB  |  527 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  21. __DIALOGS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  30.     include 'Memory.a'
  31.     ENDIF
  32. ;        include 'Types.a'                                            ;
  33. ;        include 'MixedMode.a'                                        ;
  34.  
  35.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  36.     include 'Menus.a'
  37.     ENDIF
  38. ;        include 'Quickdraw.a'                                        ;
  39. ;            include 'QuickdrawText.a'                                ;
  40.  
  41.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  42.     include 'Controls.a'
  43.     ENDIF
  44.  
  45.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  46.     include 'Windows.a'
  47.     ENDIF
  48. ;        include 'Events.a'                                            ;
  49. ;            include 'OSUtils.a'                                    ;
  50.  
  51.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  52.     include 'TextEdit.a'
  53.     ENDIF
  54.  
  55.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  56.     include 'Events.a'
  57.     ENDIF
  58.  
  59. ctrlItem                        EQU        4
  60. btnCtrl                            EQU        0
  61. chkCtrl                            EQU        1
  62. radCtrl                            EQU        2
  63. resCtrl                            EQU        3
  64. statText                        EQU        8
  65. editText                        EQU        16
  66. iconItem                        EQU        32
  67. picItem                            EQU        64
  68. userItem                        EQU        0
  69. itemDisable                        EQU        128
  70. ok                                EQU        1
  71. cancel                            EQU        2
  72. stopIcon                        EQU        0
  73. noteIcon                        EQU        1
  74. cautionIcon                        EQU        2
  75.  
  76. ; new, more standard names for dialog item constants 
  77. kControlDialogItem                EQU        ctrlItem
  78. kButtonDialogItem                EQU        ctrlItem + btnCtrl
  79. kCheckBoxDialogItem                EQU        ctrlItem + chkCtrl
  80. kRadioButtonDialogItem            EQU        ctrlItem + radCtrl
  81. kResourceControlDialogItem        EQU        ctrlItem + resCtrl
  82. kStaticTextDialogItem            EQU        statText
  83. kEditTextDialogItem                EQU        editText
  84. kIconDialogItem                    EQU        iconItem
  85. kPictureDialogItem                EQU        picItem
  86. kUserDialogItem                    EQU        userItem
  87. kItemDisableBit                    EQU        itemDisable
  88. kStdOkItemIndex                    EQU        ok
  89. kStdCancelItemIndex                EQU        cancel
  90. kStopIcon                        EQU        stopIcon
  91. kNoteIcon                        EQU        noteIcon
  92. kCautionIcon                    EQU        cautionIcon
  93.  
  94.     IF OLDROUTINENAMES  THEN
  95. kOkItemIndex                    EQU        kStdOkItemIndex
  96. kCancelItemIndex                EQU        kStdCancelItemIndex
  97.  
  98.     ENDIF
  99. ; typedef SInt16             DITLMethod
  100.  
  101. overlayDITL                        EQU        0
  102. appendDITLRight                    EQU        1
  103. appendDITLBottom                EQU        2
  104.  
  105. ; typedef short             StageList
  106. ; typedef OSType             DialogPropertyTag
  107.     IF STRICT_WINDOWS  THEN
  108.     ELSE
  109. ; typedef WindowPtr         DialogPtr
  110. ; typedef DialogPtr         DialogRef
  111.     ENDIF
  112.     IF ¬ STRICT_WINDOWS  THEN
  113. DialogRecord             RECORD    0
  114. window                     ds     WindowRecord ; offset: $0 (0)
  115. items                     ds.l   1        ; offset: $9C (156)
  116. textH                     ds.l   1        ; offset: $A0 (160)
  117. editField                 ds.w   1        ; offset: $A4 (164)
  118. editOpen                 ds.w   1        ; offset: $A6 (166)
  119. aDefItem                 ds.w   1        ; offset: $A8 (168)
  120. sizeof                     EQU *            ; size:   $AA (170)
  121.                         ENDR
  122.  
  123. ; typedef struct DialogRecord  DialogRecord
  124. ; typedef DialogRecord         *DialogPeek
  125.     ENDIF
  126. DialogTemplate             RECORD    0
  127. boundsRect                 ds     Rect    ; offset: $0 (0)
  128. procID                     ds.w   1        ; offset: $8 (8)
  129. visible                     ds.b   1        ; offset: $A (10)
  130. filler1                     ds.b   1        ; offset: $B (11)
  131. goAwayFlag                 ds.b   1        ; offset: $C (12)
  132. filler2                     ds.b   1        ; offset: $D (13)
  133. refCon                     ds.l   1        ; offset: $E (14)
  134. itemsID                     ds.w   1        ; offset: $12 (18)
  135. title                     ds.l   64        ; offset: $14 (20)
  136. sizeof                     EQU *            ; size:   $114 (276)
  137.                         ENDR
  138.  
  139. ; typedef struct DialogTemplate  DialogTemplate
  140. ; typedef DialogTemplate     *DialogTPtr, **DialogTHndl
  141. AlertTemplate             RECORD    0
  142. boundsRect                 ds     Rect    ; offset: $0 (0)
  143. itemsID                     ds.w   1        ; offset: $8 (8)
  144. stages                     ds.w   1        ; offset: $A (10)
  145. sizeof                     EQU *            ; size:   $C (12)
  146.                         ENDR
  147.  
  148. ; typedef struct AlertTemplate  AlertTemplate
  149. ; typedef AlertTemplate     *AlertTPtr, **AlertTHndl
  150. ;
  151. ; pascal void InitDialogs(void *ignored)
  152. ;
  153.     IF ¬ GENERATINGCFM THEN
  154.         _InitDialogs:    OPWORD    $A97B
  155.     ELSE
  156.         IMPORT_CFM_FUNCTION    InitDialogs
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal void ErrorSound(SoundUPP soundProc)
  161. ;
  162.     IF ¬ GENERATINGCFM THEN
  163.         _ErrorSound:    OPWORD    $A98C
  164.     ELSE
  165.         IMPORT_CFM_FUNCTION    ErrorSound
  166.     ENDIF
  167.  
  168. ;
  169. ; pascal DialogRef NewDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl)
  170. ;
  171.     IF ¬ GENERATINGCFM THEN
  172.         _NewDialog:    OPWORD    $A97D
  173.     ELSE
  174.         IMPORT_CFM_FUNCTION    NewDialog
  175.     ENDIF
  176.  
  177. ;
  178. ; pascal DialogRef GetNewDialog(short dialogID, void *dStorage, WindowRef behind)
  179. ;
  180.     IF ¬ GENERATINGCFM THEN
  181.         _GetNewDialog:    OPWORD    $A97C
  182.     ELSE
  183.         IMPORT_CFM_FUNCTION    GetNewDialog
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal void CloseDialog(DialogRef theDialog)
  188. ;
  189.     IF ¬ GENERATINGCFM THEN
  190.         _CloseDialog:    OPWORD    $A982
  191.     ELSE
  192.         IMPORT_CFM_FUNCTION    CloseDialog
  193.     ENDIF
  194.  
  195. ;
  196. ; pascal void DisposeDialog(DialogRef theDialog)
  197. ;
  198.     IF ¬ GENERATINGCFM THEN
  199.         _DisposeDialog:    OPWORD    $A983
  200.     ELSE
  201.         IMPORT_CFM_FUNCTION    DisposeDialog
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  206. ;
  207.     IF ¬ GENERATINGCFM THEN
  208.         _ParamText:    OPWORD    $A98B
  209.     ELSE
  210.         IMPORT_CFM_FUNCTION    ParamText
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal void ModalDialog(ModalFilterUPP modalFilter, short *itemHit)
  215. ;
  216.     IF ¬ GENERATINGCFM THEN
  217.         _ModalDialog:    OPWORD    $A991
  218.     ELSE
  219.         IMPORT_CFM_FUNCTION    ModalDialog
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  224. ;
  225.     IF ¬ GENERATINGCFM THEN
  226.         _IsDialogEvent:    OPWORD    $A97F
  227.     ELSE
  228.         IMPORT_CFM_FUNCTION    IsDialogEvent
  229.     ENDIF
  230.  
  231. ;
  232. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogRef *theDialog, short *itemHit)
  233. ;
  234.     IF ¬ GENERATINGCFM THEN
  235.         _DialogSelect:    OPWORD    $A980
  236.     ELSE
  237.         IMPORT_CFM_FUNCTION    DialogSelect
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal void DrawDialog(DialogRef theDialog)
  242. ;
  243.     IF ¬ GENERATINGCFM THEN
  244.         _DrawDialog:    OPWORD    $A981
  245.     ELSE
  246.         IMPORT_CFM_FUNCTION    DrawDialog
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal void UpdateDialog(DialogRef theDialog, RgnHandle updateRgn)
  251. ;
  252.     IF ¬ GENERATINGCFM THEN
  253.         _UpdateDialog:    OPWORD    $A978
  254.     ELSE
  255.         IMPORT_CFM_FUNCTION    UpdateDialog
  256.     ENDIF
  257.  
  258. ;
  259. ; pascal short Alert(short alertID, ModalFilterUPP modalFilter)
  260. ;
  261.     IF ¬ GENERATINGCFM THEN
  262.         _Alert:    OPWORD    $A985
  263.     ELSE
  264.         IMPORT_CFM_FUNCTION    Alert
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal short StopAlert(short alertID, ModalFilterUPP modalFilter)
  269. ;
  270.     IF ¬ GENERATINGCFM THEN
  271.         _StopAlert:    OPWORD    $A986
  272.     ELSE
  273.         IMPORT_CFM_FUNCTION    StopAlert
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal short NoteAlert(short alertID, ModalFilterUPP modalFilter)
  278. ;
  279.     IF ¬ GENERATINGCFM THEN
  280.         _NoteAlert:    OPWORD    $A987
  281.     ELSE
  282.         IMPORT_CFM_FUNCTION    NoteAlert
  283.     ENDIF
  284.  
  285. ;
  286. ; pascal short CautionAlert(short alertID, ModalFilterUPP modalFilter)
  287. ;
  288.     IF ¬ GENERATINGCFM THEN
  289.         _CautionAlert:    OPWORD    $A988
  290.     ELSE
  291.         IMPORT_CFM_FUNCTION    CautionAlert
  292.     ENDIF
  293.  
  294. ;
  295. ; pascal void GetDialogItem(DialogRef theDialog, short itemNo, short *itemType, Handle *item, Rect *box)
  296. ;
  297.     IF ¬ GENERATINGCFM THEN
  298.         _GetDialogItem:    OPWORD    $A98D
  299.     ELSE
  300.         IMPORT_CFM_FUNCTION    GetDialogItem
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal void SetDialogItem(DialogRef theDialog, short itemNo, short itemType, Handle item, const Rect *box)
  305. ;
  306.     IF ¬ GENERATINGCFM THEN
  307.         _SetDialogItem:    OPWORD    $A98E
  308.     ELSE
  309.         IMPORT_CFM_FUNCTION    SetDialogItem
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void HideDialogItem(DialogRef theDialog, short itemNo)
  314. ;
  315.     IF ¬ GENERATINGCFM THEN
  316.         _HideDialogItem:    OPWORD    $A827
  317.     ELSE
  318.         IMPORT_CFM_FUNCTION    HideDialogItem
  319.     ENDIF
  320.  
  321. ;
  322. ; pascal void ShowDialogItem(DialogRef theDialog, short itemNo)
  323. ;
  324.     IF ¬ GENERATINGCFM THEN
  325.         _ShowDialogItem:    OPWORD    $A828
  326.     ELSE
  327.         IMPORT_CFM_FUNCTION    ShowDialogItem
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal void SelectDialogItemText(DialogRef theDialog, short itemNo, short strtSel, short endSel)
  332. ;
  333.     IF ¬ GENERATINGCFM THEN
  334.         _SelectDialogItemText:    OPWORD    $A97E
  335.     ELSE
  336.         IMPORT_CFM_FUNCTION    SelectDialogItemText
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal void GetDialogItemText(Handle item, Str255 text)
  341. ;
  342.     IF ¬ GENERATINGCFM THEN
  343.         _GetDialogItemText:    OPWORD    $A990
  344.     ELSE
  345.         IMPORT_CFM_FUNCTION    GetDialogItemText
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  350. ;
  351.     IF ¬ GENERATINGCFM THEN
  352.         _SetDialogItemText:    OPWORD    $A98F
  353.     ELSE
  354.         IMPORT_CFM_FUNCTION    SetDialogItemText
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal short FindDialogItem(DialogRef theDialog, Point thePt)
  359. ;
  360.     IF ¬ GENERATINGCFM THEN
  361.         _FindDialogItem:    OPWORD    $A984
  362.     ELSE
  363.         IMPORT_CFM_FUNCTION    FindDialogItem
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal DialogRef NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon, Handle items)
  368. ;
  369.     IF ¬ GENERATINGCFM THEN
  370.         _NewColorDialog:    OPWORD    $AA4B
  371.     ELSE
  372.         IMPORT_CFM_FUNCTION    NewColorDialog
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal short GetAlertStage(void)
  377. ;
  378.     IF ¬ GENERATINGCFM THEN
  379.         Macro
  380.         _GetAlertStage         &dest=(sp)
  381.         move.w               $0A9A,&dest
  382.         EndM
  383.     ELSE
  384.         IMPORT_CFM_FUNCTION    GetAlertStage
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal void ResetAlertStage(void)
  389. ;
  390.     IF ¬ GENERATINGCFM THEN
  391.         Macro
  392.         _ResetAlertStage
  393.             dc.w     $4278
  394.             dc.w     $0A9A
  395.         EndM
  396.     ELSE
  397.         IMPORT_CFM_FUNCTION    ResetAlertStage
  398.     ENDIF
  399.  
  400. ;
  401. ; pascal void SetDialogFont(short value)
  402. ;
  403.     IF ¬ GENERATINGCFM THEN
  404.         Macro
  405.         _SetDialogFont         &src=(sp)+
  406.         move.w               &src,$0AFA
  407.         EndM
  408.     ELSE
  409.         IMPORT_CFM_FUNCTION    SetDialogFont
  410.     ENDIF
  411.  
  412. ;
  413. ; pascal void AppendDITL(DialogRef theDialog, Handle theHandle, DITLMethod method)
  414. ;
  415.     IF GENERATINGCFM THEN
  416.         IMPORT_CFM_FUNCTION    AppendDITL
  417.     ENDIF
  418.  
  419. ;
  420. ; pascal short CountDITL(DialogRef theDialog)
  421. ;
  422.     IF GENERATINGCFM THEN
  423.         IMPORT_CFM_FUNCTION    CountDITL
  424.     ENDIF
  425.  
  426. ;
  427. ; pascal void ShortenDITL(DialogRef theDialog, short numberItems)
  428. ;
  429.     IF GENERATINGCFM THEN
  430.         IMPORT_CFM_FUNCTION    ShortenDITL
  431.     ENDIF
  432.  
  433. ;
  434. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  435. ;
  436.     IF ¬ GENERATINGCFM THEN
  437.         Macro
  438.         _GetStdFilterProc
  439.             move.w    #$0203,d0
  440.             dc.w     $AA68
  441.         EndM
  442.     ELSE
  443.         IMPORT_CFM_FUNCTION    GetStdFilterProc
  444.     ENDIF
  445.  
  446. ;
  447. ; pascal OSErr SetDialogDefaultItem(DialogRef theDialog, short newItem)
  448. ;
  449.     IF ¬ GENERATINGCFM THEN
  450.         Macro
  451.         _SetDialogDefaultItem
  452.             move.w    #$0304,d0
  453.             dc.w     $AA68
  454.         EndM
  455.     ELSE
  456.         IMPORT_CFM_FUNCTION    SetDialogDefaultItem
  457.     ENDIF
  458.  
  459. ;
  460. ; pascal OSErr SetDialogCancelItem(DialogRef theDialog, short newItem)
  461. ;
  462.     IF ¬ GENERATINGCFM THEN
  463.         Macro
  464.         _SetDialogCancelItem
  465.             move.w    #$0305,d0
  466.             dc.w     $AA68
  467.         EndM
  468.     ELSE
  469.         IMPORT_CFM_FUNCTION    SetDialogCancelItem
  470.     ENDIF
  471.  
  472. ;
  473. ; pascal OSErr SetDialogTracksCursor(DialogRef theDialog, Boolean tracks)
  474. ;
  475.     IF ¬ GENERATINGCFM THEN
  476.         Macro
  477.         _SetDialogTracksCursor
  478.             move.w    #$0306,d0
  479.             dc.w     $AA68
  480.         EndM
  481.     ELSE
  482.         IMPORT_CFM_FUNCTION    SetDialogTracksCursor
  483.     ENDIF
  484.  
  485.     IF OLDROUTINENAMES  THEN
  486.     IF ¬ GENERATINGCFM  THEN
  487. ;
  488. ; pascal void CouldDialog(short dialogID)
  489. ;
  490.     IF ¬ GENERATINGCFM THEN
  491.         _CouldDialog:    OPWORD    $A979
  492.     ELSE
  493.         IMPORT_CFM_FUNCTION    CouldDialog
  494.     ENDIF
  495.  
  496. ;
  497. ; pascal void FreeDialog(short dialogID)
  498. ;
  499.     IF ¬ GENERATINGCFM THEN
  500.         _FreeDialog:    OPWORD    $A97A
  501.     ELSE
  502.         IMPORT_CFM_FUNCTION    FreeDialog
  503.     ENDIF
  504.  
  505. ;
  506. ; pascal void CouldAlert(short alertID)
  507. ;
  508.     IF ¬ GENERATINGCFM THEN
  509.         _CouldAlert:    OPWORD    $A989
  510.     ELSE
  511.         IMPORT_CFM_FUNCTION    CouldAlert
  512.     ENDIF
  513.  
  514. ;
  515. ; pascal void FreeAlert(short alertID)
  516. ;
  517.     IF ¬ GENERATINGCFM THEN
  518.         _FreeAlert:    OPWORD    $A98A
  519.     ELSE
  520.         IMPORT_CFM_FUNCTION    FreeAlert
  521.     ENDIF
  522.  
  523.     ENDIF
  524.     ELSE
  525.     ENDIF
  526.     ENDIF ; __DIALOGS__
  527.